package com.alan.drools.demo.controller;

import com.alan.drools.demo.model.Person;
import com.alan.drools.demo.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("person")
public class PersonController {

    @Autowired
    PersonService personService;

    @GetMapping("getAllList")
    public List<Person> getAllList(){
        return personService.getlistPerson();
    }

    @GetMapping("getAllList2")
    public List<Person> getAllList2(){
        return personService.getlistPerson2();
    }

}
